﻿using System.Collections.Generic;
using AwesomeSSPLSLogik;

namespace AwesomeLogikFacade
{
  public class LogikFacade
    {
        
      public static bool DeleteGameSession(int gameSessionId)
      {              
           return LGameHandler.DeleteGameSession(gameSessionId);         
      }

      public static bool DeletePlayerSession(int playerId, int sessionId)
      {
          return LGameHandler.DeletePlayerSession(playerId, sessionId);
      }

      public static bool CreateNonrandomGamesession(int playerId, int gameId, int rounds)
      {
          return LGameHandler.CreateNonrandomGamesession(playerId, gameId, rounds);          
      }

      public static bool UpdateGameRounds(int id, int rounds)
      {
          return LGameHandler.UpdateGameRounds(id, rounds);
      }

      public static List<LGameSession> GetGameSessionList(string namn)
      {
          return LGameHandler.GetGameSessionLogic(namn);
      }

      public static bool CheckPlayer(string namn)
      {
          return LPlayerHandler.CheckPlayerLogic(namn);
      }

      public static bool SetAndControlPlayerName(string name)
      {
          return LPlayerHandler.SetAndControlPlayerNameLogic(name);
      }

      public static List<LGame> GetAllGames()
      {
          return LGameHandler.GetGameList();
      }

      public static List<LPlayer> GetAllPlayers()
      {
          return LPlayerHandler.GetPlayerListLogic();
      }


      public static bool AddPlayerSession(int playerId, int sessionId)
      {
          return LPlayerHandler.AddPlayerSession(playerId, sessionId);
      }

      public static bool MakePlayerChoice(int gameSessionId, int playerId, int playerChoiceId)
      {
          return LPlayerHandler.MakePlayerChoice(gameSessionId, playerId, playerChoiceId);
      }

      public static List<LGameSession> GetAllActiveGameSessions()
      {
          return LGameHandler.GetAllActiveGameSessionsLogic();
      }

      public static LPlayer loginPlayer (string login , string password)
      {
          return LPlayerHandler.LoginPlayer(login, password);
      }

      public static List<LGameSession> GetAllJoinableGameSessions(int gameId)
      {
          return LGameHandler.GetAllJoinableGameSessions(gameId);
      }

      public static List<LGameSession> GetPlayersGameSessions(int playerId)
      {
          return LGameHandler.GetPlayersGameSessions(playerId);
      }
    }
}
